var ns;
var app = new Vue({
    el: '#app',
    data: {
        ID:0,
        list:[],
        pageindex:0,
        pagesize:10,
        can_scroll: false,
    },
    methods: {
        get_data: function() {
            var that = this;
            that.can_scroll = false;
            var options = {};
            options.action = 'gethousekeepercommentlist';
            options.ID = that.ID;
            options.pageindex = that.pageindex;
            options.pagesize = that.pagesize;
            ns.post(options, function(succeed, data, err) {
                if (data.status) {
                    if (data.data.length == that.pagesize) {
                        that.can_scroll = true;
                    }
                    if (that.pageindex == 0) {
                        that.list = data.data;
                    } else {
                        that.list = that.list.concat(data.data);
                    }
                    console.log(JSON.stringify(that.list));
                } else if (err) {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            }, {
                toast: true
            });
        },
        
    }
});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    app.ID = api.pageParam.ID;
    console.log(JSON.stringify(app.ID));
    app.get_data();
};